<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文字</title>
  <style>
    html,
    body {
      width: 100%;
      height: 100%;
      background-color: #000;
      margin: 0;
    }

    #div1 {
      width: 600px;
      height: 600px;
      background-color: #fff;
      margin: 0 auto;
    }
  </style>
</head>

<body>
  <div id="div1">
    <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
      <circle cx="100" cy="200" r="50" fill="transparent" stroke="red" stroke-width="5"></circle>
      <text x="100" y="200" font-size="20" text-anchor="end">
        水平居左
      </text>
      <circle cx="300" cy="200" r="50" fill="transparent" stroke="red" stroke-width="5"></circle>
      <text x="300" y="200" font-size="20" text-anchor="middle">
        水平居中
      </text>
      <circle cx="500" cy="200" r="50" fill="transparent" stroke="red" stroke-width="5"></circle>
      <text x="500" y="200" font-size="20" text-anchor="start">
        水平居右
      </text>

      <g style="cursor:pointer">
        <circle cx="300" cy="400" r="80" fill="transparent" stroke="red" stroke-width="5">
        </circle>
        <image x="250" y="350" width="100" height="100" xlink:href="./img/1.jpg"></image>
          
        <!-- 文字高度一半 + y -2 -->
        <text x="300" y="408" font-size="20" text-anchor="middle">
          水平垂直居中
        </text>
      </g>


    </svg>
  </div>
</body>

</html>